// 面向对象： 封闭、 继承、 多态

function Person(id, name, age) {
    this.id = id;
    this.name = name;
    this.age = age;

}

Person.prototype.eat = function (count, food) {
    console.log('给我来%s碗%s', count, food);
}
Person.prototype.say = function (content) {
    console.log('%s在说：%s', this.name, content)
}

const zs = new Person('421xxxx003', '张三', 20);
zs.say('我们一块去吃饭吧！');
zs.eat(10, '小炒肉')


function Student(id, name, age, sid, school, major) {
    this.sid = sid;
    this.school = school;
    this.major = major
    Person.call(this, id, name, age)
}

Student.prototype = Person.prototype;
Student.prototype.constructor = Student;

Student.prototype.doHomework = function (type) {
    console.log('%s在做%s作业', this.name, type);
}

const dlj = new Student('421xxxx07', '邓兰君', 20, '10002777', '武汉', '计算机');

dlj.doHomework('高等数学')
dlj.eat(2, '兰州拉面')

















